<?php
     if(isset($_GET['secao'])){
                    session_start();
                    if(strcmp(session_id(),$_GET['secao'])==1){
                        header('Location: Login.php');
                    }
    echo "<HTML>";
    echo "<HEAD>";
    echo "<Link rel=\"stylesheet\" href=\"Consultas.css\" type=\"text/css\"/>";
    echo "</head>";
    echo "<body>";

    echo "<a href=FormularioFuncionario.php?act=cad&secao=".$_GET['secao'].">";
    echo "<img src=./Icones/cad.png title=\"Cadastrar\"> Cadastrar Funcionario";
    echo "</a>";

    include_once 'Conexao.php';
    $bd = new Conexao();
    $bd->conectar();
    $chave = "";
    $obj=$bd->selectFuncionario($chave);
    echo "<ul id=consulta>";
    while($dados = @mysql_fetch_array($obj)){
        echo "<li class=consulta>";
        echo "<table border=1px><caption>Funcionario: ".$dados['idFuncionario']."</caption>";
            echo "<tr>";
                echo "<td>";
                    echo "Nome: ".$dados['Nome'];
                echo "<td>";
                    echo "Usuário: ".$dados['usuario'];
                echo "<tr>";
                    echo "<td>";
                        echo "<a href=FormularioFuncionario.php?act=alt&id=".$dados['idFuncionario']."&secao=".$_GET['secao'].">";
                        echo "<img src=../Imagens/alterar.jpg title=Editar float=right>";
                        echo "</a>";
                    echo "<td>";
                        echo "<a href=inserts.php?act=remFuncionario&id=".$dados['idFuncionario']."&secao=".$_GET['secao'].">";
                        echo "<img src=../Imagens/excluir.jpg title=Excluir>";
                        echo "</a>";
        echo "</table>";
        echo "</li>";
    }
    echo "</ul>";
    echo "</body>";
    echo "</html>";
    
     }else{
       header('Location: Login.php');
 }
?>

